﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified"
           elementFormDefault="qualified"
           targetNamespace="http://www.dotnetage.com/XML/Schema/package"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:pkg="http://www.dotnetage.com/XML/Schema/package">
  <xs:element name="package">
    <xs:complexType>
      <xs:all>
        <xs:element name="author" nillable="true">
          <xs:complexType>
            <xs:attribute name="name" type="xs:string" use="required" />
            <xs:attribute name="organzation" type="xs:string" use="optional" />
            <xs:attribute name="href" type="xs:string" use="optional" />
            <xs:attribute name="email" type="xs:string" use="required" />
          </xs:complexType>
        </xs:element>
        <xs:element name="name" type="xs:string" />
        <xs:element name="title" type="xs:string" minOccurs="0"/>
        <xs:element name="description" type="xs:string"  minOccurs="0" />
        <xs:element name="version"  maxOccurs="1" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="build" type="xs:string" maxOccurs="1" minOccurs="0"/>
              <xs:element name="notes" type="xs:string" maxOccurs="1" minOccurs="0"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="published" type="xs:dateTime" />
        <xs:element maxOccurs="1" minOccurs="0" name="licenses">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" minOccurs="0" name="license">
                <xs:complexType>
                  <xs:attribute name="name" type="xs:string" use="required" />
                  <xs:attribute name="href" type="xs:string" use="optional" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element maxOccurs="1"  minOccurs="0"  name="images">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded"  minOccurs="0"  name="img">
                <xs:complexType>
                  <xs:attribute name="title" type="xs:string" use="optional" />
                  <xs:attribute name="src" type="xs:string" use="required" />
                  <xs:attribute name="default" type="xs:boolean" use="optional" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element maxOccurs="1"  minOccurs="0"  name="links">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="link"  minOccurs="0" >
                <xs:complexType>
                  <xs:attribute name="title" type="xs:string" use="optional" />
                  <xs:attribute name="href" type="xs:string" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:all>
    </xs:complexType>
  </xs:element>
</xs:schema>